{ config, pkgs, ... }:

{
  home.file.".config/fish/config.fish".text = ''
    set  GTK_IM_MODULE fcitx
    set  QT_IM_MODULE fcitx
    set  QT4_IM_MODULE fcitx
    set  XMODIFIERS "@im=fcitx"
    set  SDL_IM_MODULE fcitx
    set  INPUT_METHOD fcitx
    set  SDL2_IM_MODULE fcitx
    set  GLFW_IM_MODULE ibus

    set -x RUSTUP_DIST_SERVER https://mirrors.ustc.edu.cn/rust-static
    set -x RUSTUP_UPDATE_ROOT https://mirrors.ustc.edu.cn/rust-static/rustup
    set -x RUST_SRC_PATH "$(rustc --print sysroot)/lib/rustlib/x86_64-apple-darwin/lib/"
    set -x GO111MODULE on
    set -x GOPROXY https://goproxy.cn
    set -x RUST_BACKTRACE full
    set -x HEX_MIRROR https://hexpm.upyun.com
    set -x HEX_CDN https://hexpm.upyun.com
    # set USER_SITE $HOME/.local/lib/python/site-packages
    # set USER_BASE $HOME/.local/lib/python
    set -x PATH $HOME/.dotnet/tools/ $HOME/.local/bin /usr/share/nvm/ $HOME/go/bin  $HOME/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/ $HOME/.cargo/bin $HOME/.emacs.d/bin $HOME/.ghcup/bin /usr/lib/emscripten $HOME/lib/nodejs/node_global/bin/ $HOME/.config/yarn/global/node_modules/.bin/ $PATH
    set -x VOL_HOME /home/podman
    #set -x RUST_BACKTRACE 1
    set -x DOOMGITCONFIG $HOME/.gitconfig
    abbr -a vim vim
    abbr -a v nvim
    abbr -a e emacs -nw
    abbr -a ew emacs &
    abbr -a docker podman
    abbr -a trs tree-rs
    abbr -a g++2a g++ -std=c++2a -fmodules-ts

    function fish_greeting

    end

    export VISUAL=nvim
    export EDITOR="$VISUAL"
    fish_add_path ~/.local/bin
    fish_add_path ~/.config/rofi/scripts

    alias v='nvim'
    alias fishrc='nvim ~/.config/fish/config.fish'
    alias fishso='source ~/.config/fish/config.fish'
    alias lg='lazygit'
    alias sxhkdrc='nvim ~/.config/sxhkd/sxhkdrc'
    alias nluaconf='cd ~/.config/nvim/lua/'
    alias ytaudio='yt-dlp --extract-audio --audio-format mp3'
    alias ytvideo="yt-dlp -f 'bv*[height=1080]+ba'"
    alias lofi_radio='streamlink -p mpv https://youtu.be/jfKfPfyJRdk worst'
    alias synth_radio='streamlink -p mpv https://youtu.be/MVPTGNGiI-4 worst'
    alias phonk_radio='streamlink -p mpv https://youtu.be/bVr3C-dHq_E worst'
    starship init fish | source
    direnv hook fish | source
    set -g direnv_fish_mode eval_on_arrow    # trigger direnv at prompt, and on every arrow-based directory change (default)
    set -g direnv_fish_mode eval_after_arrow # trigger direnv at prompt, and only after arrow-based directory changes before executing command
    set -g direnv_fish_mode disable_arrow    # trigger direnv at prompt only, this is similar functionality to the original behavior
  '';
}
